home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Utilities / Programming / Dialog Director 0.6 / Res Utils Examples / DD Save.as < prev    next >
Encoding:
Text File  |  1996-12-06  |  1.2 KB  |  27 lines  |  [TEXT/ToyS]

  1. on PetDialog(petName, petType, petRelation)
  2.     set dItems to [¬
  3.         {class:push button, bounds:[40, 192, 98, 212], label:"OK"}, ¬
  4.         {class:push button, bounds:[168, 192, 226, 212], label:"Cancel"}, ¬
  5.         {class:text field, bounds:[72, 16, 259, 32], label bounds:[8, 16, 57, 32], label:"name:", value:petName}, ¬
  6.         {class:radio group, bounds:[26, 48, 130, 66], button offset:[120, 16], max down:4, the items:¬
  7.             ["cat", "dog", "weasel", "snake", "moose", "parakeet", "squirrel", "gila monster"], value:petType}, ¬
  8.         {class:radio group, bounds:[26, 142, 126, 158], button offset:[120, 16], max down:2, the items:¬
  9.             ["love", "hate", "who cares?", "get along"], value:petRelation}, ¬
  10.         {class:group box, label:" Relation with: ", bounds:[10, 132, 260, 180], style:secondary group}]
  11.     
  12.     return {default:1, size:[270, 226], the items:dItems, name:"My Pets", style:movable modal}
  13. end PetDialog
  14.  
  15. on run
  16.     set dlog to PetDialog("Abbey", 3, 1)
  17.     set f to new file default name "DD Test Dialog"
  18.     res create f creator type "DiDi" file type "DiDi"
  19.     set rf to res open f with write permission
  20.     try
  21.         res put rf id 1000 data dlog name "Pet Dialog"
  22.     on error number n
  23.         res close rf
  24.         error number n
  25.     end try
  26.     res close rf
  27. end run